{{include file="default/Public/header.html"}}
<script language="javascript" src="{{$smarty.const._PUBLIC_}}js/editable/jquery.editable.js"></script>
<script src="{{$smarty.const._PUBLIC_}}js/ajax.js" type="text/javascript"></script>
<script language="javascript">
//联动下拉框	
function fide(){

    var aa=document.getElementById("type").value;
   	if(aa!=0){
    	qt_ajax_request('post',"__ROOT__/admin.php?m=fplace&a=ajax_fid",fid_back,"type="+aa);
    }
}
function fid_back(data){
	var ee = document.getElementById("seld");
	var com ="<select name=\"fid\" id=\"fid\"><option value=\"0\">请选择所属栏目</option>";
	for(var i=0;i<data.length;i++){
		com += "<option value=\""+data[i]['id']+"\">"+data[i]['name']+"</option>";
		}
	com += "</select>";
	ee.innerHTML=com;
}
</script>
<form id="myform" name="myform" method="post" action="__ROOT__/admin.php?m=fplace&a=manage"  >
<div id="pageTop">
	<div class="addBtn"><a href='{{U url="fplace/add"}}'>添加地区</a></div>
	<div class="batch">
	<form action="__ROOT__/admin.php?m=fplace&a=manage" method="POST">
	<div style="float:left;">
	<select name="type" id="type" onchange="fide()">
        <option value="0">请选择所属栏目</option>
        <option value="2">台湾游</option>
        <option value="3">出镜游</option>
        <option value="4">国内游</option>
        <option value="5">商务会奖游</option>
      </select>
      </div>
      <div name="seld" id="seld" style="float:left;">
      	<select name="fid" id="fid">
        <option value="0">请选择地区大类</option>
      	</select>
      </div>
      <input type="submit" name="submit" value="确 定" />
      </div>
</div>
<div id="pageCo">
	<div class="listForm">
		<table cellpadding="0" cellspacing="0">
			<thead>
				<tr>
					<th width="100">ID</th>	
					<th width="100">所属栏目</th>					
					<th width="250">名称</th>										
					<th width="200">父类ID</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
			{{foreach from=$data.info item=v}}      
		      <tr>
		      	<td>{{$v.id}}</td>
		        <td>{{if $v.type==2}}台湾游{{elseif $v.type==3}}出镜游{{elseif $v.type==4}}国内游{{elseif $v.type==5}}商务会奖游{{/if}}</td>
		        <td>{{$v.name}}</td>
		        <td>{{$v.fid}}</td>
		        <td>
		        	<a href="{{U url="fplace/delete?id=`$v.id`&fid=`$v.fid`"}}" title="删除">删除</a>
		        </td>
		      </tr>
		      {{foreachelse}}
		      <tr><td colspan="9">暂无记录！</td></tr>
		      {{/foreach}}
			</tbody>
		</table>	
	</div>	
	<div class="pageList">
		{{$data.pages}}
		<ul class="clearit"></ul> 
	</div>
</div>
</form>
{{include file="default/Public/footer.html"}}